#include <user.h>
#include <defs.h>
#include <ts7200.h>
#include <io.h>

void NameServer();
void TrainTxServer();
void IdleTask();

void UserInit() {
  int child_tid;
  child_tid = Create(4, &NameServer);
  Send(child_tid, NULL, 0, NULL, 0);
  child_tid = Create(5, &TrainTxServer);
  Send(child_tid, NULL, 0, NULL, 0);
  Create(0, &IdleTask);

  // bombard UART1 with characters!
  int i;
  while (TRUE) {
    Putc(COM1, 'A');
    Putc(COM1, ' ');
    for (i = 0; i < 10; i++) {
      Putc(COM1, '0'+i);
    }
    Putc(COM1, ' ');
    Putc(COM1, 'B');
    Putc(COM1, ' ');
    for (i = 0; i < 10; i++) {
      Putc(COM1, '0'+i);
    }
    Putc(COM1, '\r');
    Putc(COM1, '\n');
  }
  
  Exit();
}
